package com.liwei.vip.canal.listener;

import com.liwei.vip.mall.goods.model.AdItems;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

@Component
@CanalTable(value = "ad_items")
public class AdItemsHandler implements EntryHandler<AdItems> {

    /**
     * 数据库增加数据，执行该方法
     * @param adItems
     */
    @Override
    public void insert(AdItems adItems) {
        System.out.println("insert:"+adItems);
    }

    /**
     * 数据库更新数据，执行该方法
     * @param before
     * @param after
     */
    @Override
    public void update(AdItems before, AdItems after) {
        System.out.println("update:"+before);
        System.out.println("after:"+after);
    }

    /**
     * 数据库更新数据，执行该方法
     * @param adItems
     */
    @Override
    public void delete(AdItems adItems) {
        System.out.println("delete:"+adItems);
    }
}
